extends Area2D

@export var amount: float = 1.0
@onready var animation_player: AnimationPlayer = $AnimationPlayer


func _on_body_entered(_body: Node2D) -> void:
	GlobalGameData.change_hp(amount)
	animation_player.play("collect")
	collision_mask = 0

	await animation_player.animation_finished
	queue_free()
